<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        'use strict'
        function A(){
            var a = 1;
            this.b = 1;
            var that = this;
            this.add = function(){
                ++a;
                that.b++;
            }
            this.say = function(){
                console.log('a:' + a,',b:' + that.b);
            }
        }

        var a1 = new A();
        a1.add();
        a1.add();
        a1.say();
        var a2 = new A();
        a2.add();
        a2.add();
        a2.say();
    </script>
</body>
</html>